package org.bob.web.model;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;

import javax.annotation.Nonnull;
import java.io.Serializable;

/**
 * 搜索建议请求
 */
public class SuggestReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 业务编码
     */
    @NotEmpty(message = "业务编码不能为空")
    private String bizCode;

    /**
     * 建议匹配类型
     * 默认全部类型
     */
    private int type = 7;

    /**
     * 搜索建议索引
     */
    @NotEmpty(message = "索引名称不能为空")
    private String index;

    /**
     * 查询前缀词语
     */
    @NotEmpty(message = "搜索前缀不能为空")
    private String prefix;

    /**
     * 查询数量(返回的最大数量)
     */
    @Min(value = 1,message = "建议搜索数量不能少于1")
    @Max(value = 10,message = "建议搜索数量不能多于10")
    private int size = 10;

    public String getBizCode() {
        return bizCode;
    }

    public void setBizCode(String bizCode) {
        this.bizCode = bizCode;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }
}
